Tests collectGarbage.

Running test: testCollectGarbage
WeakRef state: WeakRef is cleared after GC.